﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Web.Services;
using System.Globalization;
using Public;

namespace WebsiteAdmin.Wilson.ProInfo.Handler
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class ProOtherDelete : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            if(Cookie.AdminLoginName!=null && Cookie.AdminLoginName!="")
            {
                int pkid = Convert.ToInt16(context.Request["PKID"], CultureInfo.InvariantCulture);
                context.Response.Write(Delete(Global.ConnWilson, pkid) == 1 ? "{\"Done\":\"Success\"}" : "{\"Done\":\"Failed\"}");
            }
            HttpContext.Current.ApplicationInstance.CompleteRequest();
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }

        private int Delete(string strCon,int pkid) 
        {
            return Bll.ProOtherInfo.Delete(strCon, pkid);
        }
    }
}
